package com.droid.mvvmlib.databinding;

import android.view.View;

import com.droid.mvvmlib.widget.base.BaseCustomerViewData;
import com.droid.mvvmlib.widget.base.ICustomerView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

/**
 *
 * @author zyc0617
 * @since  2019/8/21 23:01
 */
public class BaseBindingViewHolder extends RecyclerView.ViewHolder {
    View view;

    public BaseBindingViewHolder(View view){
        super(view);
        this.view = view;
    }

    public void binding(@NonNull BaseCustomerViewData item) {
        if(view instanceof ICustomerView) {
            ((ICustomerView)view).setData(item);
        }
    }
}
